package org.pas.fb2.tag;

public class EpigraphTag extends Tag {

    static final String NAME = "epigraph";

    EpigraphTag(Tag parent) {
        super(parent);
        out(new StringBuilder("-- Эпиграф --"));
    }

    @Override
    public String getName() {
        return NAME;
    }

    @Override
    public Tag onChild(String name) {
        if (ParagraphTag.NAME.equals(name)) {
            return new ParagraphTag(this);
        } else if (TextAuthorTag.NAME.equals(name)) {
            return new TextAuthorTag(this);
        } else if (EmptyLineTag.NAME.equals(name)) {
            return new EmptyLineTag(this);
        } else if (PoemTag.NAME.equals(name)) {
            return new PoemTag(this);
        }
        return super.onChild(name);
    }

    @Override
    protected void doClose() {
        out("");
    }
}

